package com.dream.inspect.modules.business.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.dream.inspect.modules.app.controller.bean.SupervisionQuestionBean;
import com.dream.inspect.modules.business.entity.QuestionInfo;
import com.dream.inspect.modules.business.entity.SuperviseQuestionEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 督察问题表
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2018-06-16 17:04:52
 */
public interface SuperviseQuestionDao extends BaseMapper<SuperviseQuestionEntity> {
    List<SuperviseQuestionEntity> findSuperviseQuestionList(@Param("ew") Wrapper<SuperviseQuestionEntity> wrapper,
                                                            @Param("currPage") int currPage,
                                                            @Param("pageSize") int pageSize,
                                                            @Param("userDeptName") String userDeptName);

    int findSuperviseQuestionListCount(
            @Param("ew") Wrapper<SuperviseQuestionEntity> wrapper, @Param("userDeptName") String userDeptName);

    List<SuperviseQuestionEntity> findSuperviseQuestionListForCount(@Param("ew") Wrapper<SuperviseQuestionEntity> wrapper,
                                                                    @Param("currPage") int currPage,
                                                                    @Param("pageSize") int pageSize,
                                                                    @Param("userDeptName") String userDeptName);

    int findSuperviseQuestionListForCountNum(
            @Param("ew") Wrapper<SuperviseQuestionEntity> wrapper, @Param("userDeptName") String userDeptName);

    List<SuperviseQuestionEntity> findSuperviseQuestionDetailList(
            @Param("ew") Wrapper<SuperviseQuestionEntity> wrapper,
            @Param("userDeptName") String userDeptName);

    void insertQuestionList(@Param("m") Map<String, Object> map);

    List<SupervisionQuestionBean> getQuestionByRrcordId(@Param("rId") String rId, @Param("userId") String userId);

    /**
     * 获取统计数据
     *
     * @param standardId
     * @return
     */
    List<Map<String, Object>> getQuestionCountByStandardId(@Param("standardId") String standardId);


    int findSuperviseQuestionForModifyStatusNum(@Param("ew") Wrapper<SuperviseQuestionEntity> wrapper);
    
    List<SuperviseQuestionEntity> findSuperviseQuestionListNoImage(
            @Param("ew") Wrapper<SuperviseQuestionEntity> wrapper,
            @Param("currPage") int currPage,
            @Param("pageSize") int pageSize,
            @Param("modelId") String modelId);

    int findSuperviseQuestionListNoImageCount(
            @Param("ew") Wrapper<SuperviseQuestionEntity> wrapper, @Param("modelId") String modelId);

    int selectThisMonthCount(@Param("ew") Wrapper<SuperviseQuestionEntity> wrapper);

    /**
     * 问题趋势图
     * @param parmaes
     * @return
     */
    List<Map<String, Object>> trendsView(Map<String, Object> parmaes);

    /**
     * 四大类统计环形图
     *
     * @param parmaes
     * @return
     */

    List<Map<String, Object>> problemChartAnnular(Map<String, Object> parmaes);

    /**
     * 整改问题统计 半环形图
     * @param params
     * @return
     */
    List<Map<String, Object>> rectifyChartSemiRing(Map<String, Object> params);

    /**
     * 统计单位今年问题 整改单位统计 本年
     *
     * @param parmaes
     * @return
     */
    List<Map<String, Object>> yearDeptQuestionCount(Map<String, Object> parmaes);
    /**
     * 统计区划整改数 - app - 省市区
     * @param parmaes
     * @return
     */
    List<Map<String, Object>> findZoningQuestionStatisticsForApp(Map<String, Object> parmaes);

    List<Map<String, Object>> findZoningProvinceQuestionStatisticsForApp(Map<String, Object> parmaes);
    /**
     * 统计区划整改数 - app - 派出所
     * @param parmaes
     * @return
     */
    List<Map<String, Object>> findDeptQuestionStatisticsForApp(Map<String, Object> parmaes);

    SuperviseQuestionEntity findSuperviseQuestionForSearchPage(
            @Param("id") String id);

	int findSuperviseQuestionForSearchPageCount(@Param("ew") Wrapper<SuperviseQuestionEntity> wrapper);

	List<SuperviseQuestionEntity> selectSuperviseQuestionListPage(Pagination page, @Param("sqEntity") SuperviseQuestionEntity sqEntity);

	List<SuperviseQuestionEntity> selectQuestionDetailInfo(@Param("sqEntity") SuperviseQuestionEntity sqEntity);

	List<QuestionInfo> findQuestionInfoList(@Param("rId") String rId, @Param("zglx") String zglx);
}
